import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:xianyu_school/utils/url.dart';

class setname extends StatefulWidget {

  @override
  _setnameState createState() => _setnameState();
}

class _setnameState extends State<setname>{
  @override
  Widget build(BuildContext context) {
    TextEditingController tc = TextEditingController();
    return Scaffold(
      appBar: CupertinoNavigationBar(
        backgroundColor: Colors.yellow,
        middle: const Text('修改昵称'),
      ),
      body: ListView(
        children: [
          TextField(
            controller: tc,
          ),
          Row(
            children: [
              Expanded(
                child: Text(''), // 中间用Expanded控件
              ),
              OutlineButton(
                child: Text('保存'),
                textColor: Colors.orange,
                color: Colors.white,
                shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(20)),
                borderSide: BorderSide(color: Colors.orange, width: 1),
                onPressed: () {
                  Navigator.pop(context,tc.text);
                },
              )
            ],
          )
        ],
      )
    );
  }
}